#ifndef CFRAME_H
#define	CFRAME_H

#include <QStack>
#include <QVector>
#include <QHash>
#include <QString>

#include "data/CReference.h"

class CFrame
{
private:
    char* _code;
    int _codeSize;
    int _pointer = 0;
    QStack<char*> _operands;
    QHash<QString, char*> _variables;
    QVector<char*>* _references;

public:
    CFrame(char* code, int codeSize, QHash<QString, char*> variables, QVector<char*>& references);
    ~CFrame();

    char* code();
    int codeSize();

    int& pointer();

    void pushOperand(char* value);
    char* popOperand();
    char* peekOperand();
    void copyOperand();
    int operandCount();

    void pushChar(char value);
    void pushNull();
    void pushFalse();
    void pushTrue();

    QHash<QString, char*>& variables();

    QVector<char*>& references();
};

#endif

